<%@page import="org.yate.oa.model.LoginEntity"%>
<%@page import="java.text.SimpleDateFormat, java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>产品列表</title>
<link href="${ctx}/css/skin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/prettify.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/jquery-ui.min.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/backOffice.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.ui.core.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.ui.widget.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.multiselect.js"></script>
<script type="text/javascript">
$(function(){
    $("#kva").multiselect({
        noneSelectedText: "==请选择==",
        checkAllText: "全选",
        uncheckAllText: '全不选',
        selectedList:15
    });
    intiDate();    
});

function intiDate(){
	 $('#id').val(${t.id});
	 $("#kva").val('${t.kva}'.split(","));
 	 $("#kva").multiselect("refresh"); 
	 $('#highVol').val(${t.highVol});
	 $('#lowVol').val(${t.lowVol});
	 $('#boxNum').val(${t.boxNum});
	 $('#highVolConf').val(${t.highVolConf});
	 $('#voltageConf').val(${t.voltageConf});
	 $('#highOCConf').val('${t.highOCConf}');
	 $('#lowOCConf').val('${t.lowOCConf}');
	 $('#lowOutline').val('${t.lowOutline}');
	 $('#lowECType').val('${t.lowECType}');
	 $('#lowLike').val('${t.lowLike}');
	 $('#ftpValue').val('${t.ftp.value}');
	 lowVolChange();
	 voltageConfChange();
	 highVolConfChange();
}


function checkForm(){
	if($("#kva").val()==null){
		alert('请选择容量');
		return;
	}
	addForm.submit();
}
function lowVolChange(){
	if($('#lowVol').val() == 0){
		$('#boxNum').html('<option value="1" selected="selected">三相</option>');
	} else {
		$('#boxNum').html('<option value="0" selected="selected">单相</option>');
		$('#voltageConf').html('<option value="0">欧式配置</option>');
	}
}
function voltageConfChange(){
	var kva = $('#kva').val();
	if(kva != null && kva.length == 1 && kva[0] != '其他'){
		if(kva[0] > 630 || $('#highVol').val() == 1 || $('#lowVol').val() == 1) {
			$('#voltageConf').html('<option value="0">欧式配置</option>');
		}else{
			$('#voltageConf').html('<option value="0">欧式配置</option><option value="1">美式配置</option>');
		}
		if(kva[0] >= 50 && kva[0] <= 160 && $('#highVol').val() == 0){
			$('#lowVol').html('<option value="0">0.4KV</option><option value="1">0.23KV</option>');
		}else {
			$('#lowVol').html('<option value="0">0.4KV</option>');
			$('#boxNum').html('<option value="1">三相</option>');
		}
		lowVolChange();
		highVolConfChange();
	}
}
function highVolConfChange(){
	var kva = $('#kva').val();
	var highVolConf = $('#highVolConf').val();
	var highVol = $('#highVol').val();
	if(kva != null && kva.length == 1 && kva[0] != '其他'){
		if(kva[0] >= 50 && kva[0] <315 && highVolConf == 0){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option>');
		}
		if(kva[0] >=315 && highVolConf == 0 && highVol == 0){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option><option value="2">一进线、一计量、一出线</option><option value="3">一进线、一计量、一PT、一出线</option>');
		}
		if(kva[0] >=315 && highVolConf == 0 && highVol == 1){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option>');
		}
	}
	if(highVolConf == 1){
		$('#highVolBoxConf').html('<option value="4">一进线、一环网、一出线</option>');
	}
}
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" height="29" valign="top"
				background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/left-top-right.gif" width="17" height="29" /></td>
			<td width="" height="29" valign="top"
				background="${ctx}/images/content-bg.gif"><table width="100%"
					height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">更新产品</div></td>
					</tr>
				</table></td>
			<td width="16" valign="top"
				background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>
		<tr>
			<td height="71" valign="middle"
				background="${ctx}/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9"><table width="100%"
					height="138" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="13" valign="top">&nbsp;</td>
					</tr>
					<tr>
						<td valign="top">
							<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
								<tr>
									<td class="left_txt">当前位置：图纸管理 > 更新产品</td>
								</tr>
								<tr>
									<td height="20">
										<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
											<tr>
												<td></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td width="100%" valign="top"
										style="min-height: 350px; height: 350px;">
										<form action="${ctx}/blueprint/page/update.html" method="post" name="addForm" enctype="multipart/form-data">
											<table class="tblBill" cellpadding="0" cellspacing="0">
												<tr>
													<td width="10%">容量(KVA)：</td>
													<td>
														<select id ="kva" name="kva" title="Basic example" multiple="multiple" onchange="voltageConfChange()">
															<option value="50">50</option>
															<option value="80">80</option>
															<option value="100">100</option>
															<option value="125">125</option>
															<option value="160">160</option>
															<option value="200">200</option>
															<option value="250">250</option>
															<option value="315">315</option>
															<option value="400">400</option>
															<option value="500">500</option>
															<option value="630">630</option>
															<option value="800">800</option>
															<option value="1000">1000</option>
															<option value="其他">其他</option>
														</select>
													</td>
												</tr>
												<tr>
													<td colspan="2">电压等级</td>
												</tr>
												<tr>
													<td align="right">高压：</td>
													<td>
														<select name="highVol" id="highVol" onchange="voltageConfChange()">
															<option value="0">10KV</option>
															<option value="1">20KV</option>
														</select>
													</td>
												</tr>
												<tr>
													<td align="right">低压：</td>
													<td>
														<select name="lowVol" id="lowVol" onchange="lowVolChange()">
															<option value="0">0.4KV</option>
															<option value="1">0.23KV</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>相数：</td>
													<td>
														<select name="boxNum" id="boxNum">
															<option value="0">单相</option>
															<option value="1">三相</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>高压配置型式</td>
													<td>
														<select name="highVolConf" id="highVolConf" onchange="highVolConfChange()">
															<option value="0">终端型</option>
															<option value="1">环网型</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>变压器配置型式：</td>
													<td>
														<select name="voltageConf" id="voltageConf">
															<option value="0">欧式配置</option>
															<option value="1">美式配置</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>高压开关柜配置：</td>
													<td>
														<select name="highOCConf" id="highOCConf">
															<option value="0">一进出线</option>
															<option value="1">一进线、一出线</option>
															<option value="2">一进线、一计量、一出线</option>
															<option value="3">一进线、一计量、一PT、一出线</option>
															<option value="4">一进线、一环网、一出线</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>低压开关柜类型：</td>
													<td>
														<select name="lowOCConf" id="lowOCConf">
															<option value="0">低压计量及进线柜</option>
															<option value="1">低压出线柜</option>
															<option value="2">电容补偿柜</option>
															<option value="3">低压联络柜</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>低压出线柜出线回路</td>
													<td>
														<select name="lowOutline" id="lowOutline">
															<option value="0">3路出线</option>
															<option value="1">4路出线</option>
															<option value="2">5路出线</option>
															<option value="3">6路出线</option>
															<option value="4">7路出线</option>
															<option value="5">10路出线</option>
															<option value="6">12路出线</option>
															<option value="7">3路控制出线</option>
															<option value="8">4路控制出线</option>
															<option value="9">5路控制出线</option>
															<option value="10">6路控制出线</option>
															<option value="11">7路控制出线</option>
															<option value="12">12路控制出线</option>
															<option value="13">18路控制出线</option>
															<option value="14">21路控制出线</option>
															<option value="15">7路控制出线+4路出线</option>
															<option value="16">7路控制出线+7路出线</option>
															<option value="17">14路控制出线+14路出线</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>低压电容补偿柜类型：</td>
													<td>
														<select name="lowECType" id="lowECType">
															<option value="0">接触器投切</option>
															<option value="1">智能电容器</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>低压联络柜：</td>
													<td>
														<select name="lowLike" id="lowLike">
															<option value="0">启用</option>
															<option value="1">未启用</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>文件名称：</td>
													<td>
														<input id="ftpValue" type="text" name="ftpValue" readonly="readonly">
													</td>
												</tr>	
												<tr>
													<td>上传pdf文件：</td>
													<td>
														<input type="file" name="importLocalFile" multiple="multiple" id="importLocalFile"/><p style="color:red">如果修改文件，请更换文件的名称</p>
													</td>
												</tr>
												<tr>
													<td>
														<input type="hidden" name="submitType" value="modify" />
														<input type="hidden" name="id" id="id"/>
													</td>
													<td><input type="button" value="确定 " onclick="checkForm()"/> <input type="button" value="取消 "
														onclick="javascript:location.href='${ctx}/jsp/tzgl/list.jsp'" /></td>
												</tr>
											</table>
										</form>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
			<td background="${ctx}/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="middle" background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/buttom_left2.gif" width="17" height="17" /></td>
			<td height="17" valign="top"
				background="${ctx}/images/buttom_bgs.gif"><img
				src="${ctx}/images/buttom_bgs.gif" width="17" height="17" /></td>
			<td background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/buttom_right2.gif" width="16" height="17" /></td>
		</tr>
	</table>
</body>
</html>